<template>
	<view class="venbox">
		<view class="velist">
			<view class="listbox" v-for="(item,index) in list" :key="index" @click="gotosite(item)">
				<image class="bxoimag" :src="item.image" mode=""></image>
				<view class="itemtit">{{item.name}}</view>
				<view class="litext">{{item.intro}}</view>
				<view class="picbox">
					<view class="pricli">{{item.price}}<text style="font-size: 12px;color: #afafaf;">起</text></view>
					<!-- <view class="liidng">已预定{{item.num}}次</view> -->
				</view>
			</view>
		</view>
	</view>
</template>

<script setup>
import { ref,onMounted } from 'vue';
import request from '../../utils/request';
import {onLoad} from '@dcloudio/uni-app'
let places_id=ref()
let token=ref('')
let type1=ref()
onLoad((options)=>{
	token.value=uni.getStorageSync('token')
	places_id.value=uni.getStorageSync('places_id')
	    request.post('Price/lists',{data:{
			places_id:places_id.value
		},header:{
			"token":token.value,
		}}).then(res=>{
			console.log(res);
			list.value=res.data.data
		}).catch(err=>{
			console.log(err);
		})
	  
})

let list=ref([])
const gotosite=(item)=>{
	const id=item.id
	uni.navigateTo({
		url:`/pages/site/site?id=${id}`
	})
}
</script>

<style scoped>
	.venbox{
		width: 100%;
		height: 100vh;
		background-color: #f9f9f9;
	}
	.velist{
		display: flex;
		flex-wrap: wrap;
		align-items: center;
	}
	.listbox{
		width:350rpx;
		height: 550rpx;
		background-color: #fff;
		margin-top: 20rpx;
		border-radius: 20rpx;
		margin-left: 20rpx;
	}
	.bxoimag{
		width: 350rpx;
		height: 350rpx;
		border-radius: 20rpx;
	}
	.itemtit{
		font-size: 16px;
		padding-left:20rpx;
		margin: 10rpx 0;
		white-space: nowrap; /* 防止文本换行 */
		overflow: hidden;    /* 超出部分隐藏 */
		text-overflow: ellipsis;
	}
	.litext{
		font-size: 12px;
		padding-left:20rpx;
		color: #afafaf;
		margin-bottom:16rpx;
	}
	.picbox{
		display: flex;
		align-items: flex-end;
		justify-content: space-between;
		box-sizing: border-box;
		padding-left:20rpx;
		padding-right: 20rpx;
	}
	.pricli{
		font-size: 18px;
		color: #10c696;
	}
	.liidng{
		font-size: 12px;
		color: #afafaf;
	}
</style>
